#include <stdio.h>
#define LEN 10
double dif_max_min(double nums[], int n);
int main(void)
{
    double nums[LEN] = {3.2, 1.0, 9.9, 6.6, 5.1, 2.0, 8.3, 0.2, 4.1, 7.0};
    double ans;

    ans = dif_max_min(nums, LEN);
    printf("ans = %lf", ans);

    return 0;
}

double dif_max_min(double nums[], int n)
{
    double dif;
    double max = nums[0];
    double min = nums[0];
    int i;

    for (i = 0; i < n; i++)
    {
        max = max < nums[i] ? nums[i] : max;
        min = min > nums[i] ? nums[i] : min;      
    }
    
    return max - min;
}